package bosVM2.meta.Objects;

import java.util.Set;

import bosVM2.util.Map;

public class BosClass {
	
	private String cname;
	private Map<String, BosMethod> methods;
	private Map<String, BosField> fields;
	private BosClass _super;
	
	//util: Contructor and toString
	
	public BosClass(String name,BosClass _super)
	{ 
		cname = name;
		methods = new Map<String, BosMethod>();
		fields = new Map<String, BosField>();
		if(_super == null)
		 { this._super = null; }
		else { this._super = _super; }
		
	}
	
	public String toString()
	{
		return "class: "+cname+ " methods: " + methods + " Fields: " + fields;
	}
	
	//ClassName
	public String getClassName()
	{
		return cname;
	}
	
	//Methods
	public BosMethod getMethod(String s)
	{
		return methods.get(s);
	}
	
	public void putMethod(BosMethod m)
	{
		methods.put(m.getName(), m);
	}

	public void putField(BosField f) {
		fields.put(f.getName(), f);
	}
	
	public Set<String> getMethods()
	{
		return methods.getKeys();
	}
	
	public Set<String> getFields()
	{
		return fields.getKeys();
	}
}
